<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/6/29 13:40
 * Modified Time: 2019/6/29 13:40
 * Version: 2.0
 */

namespace App\Modules\MemberCard\Validators;


use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class CardTypeServiceValidator extends LaravelValidator
{
    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'type_id' => 'required|numeric',
            'service_id' => 'required|numeric',
            'discount' => 'required|numeric|min:0|max:100',
        ],
    ];
    protected $messages = [
        'type_id.required' => '卡类不能为空',
        'type_id.numeric' => '卡类格式错误',

        'service_id.required' => '服务id不能为空',
        'service_id.numeric' => '服务id格式错误',

        'discount.required' => '请填写折扣百分比',
        'discount.numeric' => '折扣百分比格式错误',
        'discount.min' => '折扣百分比不能低于0%',
        'discount.max' => '折扣百分比不能高于100%'


    ];
}